import dash
import dash_bootstrap_components as dbc
from zkl_pyutils_fsspec import FsLike

from .board_view import BoardView


def launch(fs: FsLike, host: str = None, port: str | int = None):
    app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
    app.layout = BoardView(fs=fs, style={
        'position': 'absolute',
        'top': '0',
        'left': '0',
        'height': '100%',
        'width': '100%',
    })
    app.run(host=host, port=port, debug=True)
